html {
  box-sizing: border-box;
  //根元素字体大小；10 / 16 = 62.5%，采用rem单位时，1rem = 10px
  font-size: 62.5%;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: inherit;
  &:before,
  &:after {
    box-sizing: inherit;
  }
}
body {
  width: 100%;
  height: 100vh;
  background-color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  overflow: hidden;
}
$numOfSlides: 5;
$slidingAT: 1.3s;
$controlSize: 60px;

.slider {
  position: relative;
  height: 100vh;
  &__slides {
    z-index: 1;
    position: relative;
    height: 100%;
  }
  &__control {
    z-index: 2;
    position: absolute;
    top: 50%;
    left: 5%;
    width: $controlSize;
    height: $controlSize;
    margin-left: calc($controlSize / -2);
    margin-top: calc($controlSize / -2);
    border-radius: 50%;
    background-color: #fff;
    transition: background-color 0.3s;
    cursor: pointer;
    &--right {
      left: 95%;
    }
    &:hover {
      background-color: #2da6ff;
      .slider__control-line {
        &::after {
          background-color: #fff;
        }
      }
    }
    &-line {
      position: absolute;
      left: 23px;
      top: 50%;
      width: 3px;
      height: 14px;
      transform-origin: 50% 0;
      transform: rotate(-45deg);
      &:nth-child(2) {
        transform: translateY(1px) rotate(-135deg);
      }
      &::after {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: #e2e2e2;
        transition: background-color 0.3s;
      }
    }
    &.a--rotation {
      .slider__control-line {
        &::after {
          animation: arrowLineRotation 0.49s;
        }
        &:nth-child(2)::after {
          animation: arrowLineRotationRev 0.49s;
        }
      }
    }
  }
  .slider__control--right {
    .slider__control-line {
      left: 37px;
      transform-origin: 1px 0;
      transform: rotate(45deg);
      &:nth-child(2) {
        transform: translateY(1px) rotate(135deg);
      }
      //   &::after {
      //     content: "";
      //     position: absolute;
      //     inset: 0;
      //     background-color: #e2e2e2;
      //     transition: background-color 0.3s;
      //   }
    }
  }
}
.slide {
  overflow: hidden;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 150vmax;
  height: 150vmax;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  transition: clip-path 0s calc($slidingAT * 0.7);
  clip-path: circle(calc($controlSize / 2) at 120vw 50%);
  &.s--prev {
    clip-path: circle(calc($controlSize / 2) at 30vw 50%);
  }
  &.s--active {
    z-index: 1;
    transition: clip-path $slidingAT;
    clip-path: circle(120vmax at 120vw 50%);
    &.s--active-prev {
      clip-path: circle(120vmax at 30vw 50%);
    }
  }
  @for $i from 1 through $numOfSlides {
    &:nth-child(#{$i}) {
      .slide__inner {
        background-image: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/142996/onepgscr-#{$i+1}.jpg");
      }
    }
  }
  &__inner {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 100vw;
    height: 100vh;
    margin-left: -50vw;
    margin-top: -50vh;
    background-size: cover;
    background-position: center center;
    &::before {
      content: "";
      position: absolute;
      inset: 0;
      background-color: rgba(0, 0, 0, 0.3);
    }
  }
  &__content {
    position: absolute;
    left: 5%;
    top: 50%;
    margin-left: calc($controlSize / -2);
    margin-top: $controlSize * 0.8;
    max-width: 480px;
    color: #fff;
  }
  &__heading {
    margin-bottom: 20px;
    font-size: 60px;
  }
  &__text {
    font-size: 25px;
    a {
      color: inherit;
    }
  }
}

@keyframes arrowLineRotation {
  to {
    transform: rotate(180deg);
  }
}
@keyframes arrowLineRotationRev {
  to {
    transform: rotate(-180deg);
  }
}
